<div id="navigator">

  <section ng-if="controller.clientId && !controller.client">
    Loading...
  </section>

  <!-- Client overview and links for client navigation -->
  <section ng-if="controller.client">
    <!-- Client overview-->
    <grr-periodic-refresh interval="30000"
                          on-refresh="controller.refreshClientDetails()">
    </grr-periodic-refresh>
    <grr-client-summary client="controller.client"></grr-client-summary>

    <!-- Client links -->
    <ul class="nav nav-list">
      <li grr-nav-link state="client.hostInfo"
          params="{clientId: controller.clientId}">
        Host Information
      </li>
      <li grr-nav-link state="client.launchFlows"
          params="{clientId: controller.clientId}"
          disabled="!controller.uiTraits.start_client_flow_nav_item_enabled || !controller.hasClientAccess">
        Start new flows
      </li>
      <li grr-nav-link state="client.vfs"
          params="{clientId: controller.clientId}"
          disabled="!controller.uiTraits.browse_virtual_file_system_nav_item_enabled || !controller.hasClientAccess">
        Browse Virtual Filesystem
      </li>
      <li grr-nav-link state="client.flows"
          params="{clientId: controller.clientId}"
          disabled="!controller.uiTraits.manage_client_flows_nav_item_enabled || !controller.hasClientAccess">
        Manage launched flows
      </li>

      <li id="HostAdvanced" grr-nav-dropdown title="Advanced">
        <ul class="nav nav-list">
          <li grr-nav-link state="client.crashes"
              params="{clientId: controller.clientId}"
              disabled="!controller.hasClientAccess">
            Crashes
          </li>
          <li grr-nav-link state="client.debugRequests"
              params="{clientId: controller.clientId}"
              disabled="!controller.hasClientAccess">
            Debug Client Requests
          </li>
          <li grr-nav-link state="client.loadStats"
              params="{clientId: controller.clientId}"
              disabled="!controller.hasClientAccess">
            Client Load Stats
          </li>
        </ul>
      </li>
    </ul>
  </section>

  <!-- Management links -->
  <section>
    <h1>Management</h1>

    <ul class="nav nav-list">
      <li grr-nav-link state="crons"
          disabled="!controller.uiTraits.cron_jobs_nav_item_enabled">
        Cron Job Viewer
      </li>
      <li grr-nav-link state="hunts"
          disabled="!controller.uiTraits.hunt_manager_nav_item_enabled">
        Hunt Manager
      </li>
      <li grr-nav-link state="stats"
          disabled="!controller.uiTraits.show_statistics_nav_item_enabled">
        Show Statistics
      </li>
    </ul>
  </section>

  <!-- Configuration links -->
  <section>
    <h1>Configuration</h1>

    <ul class="nav nav-list">
      <li grr-nav-link state="manageBinaries"
          disabled="!controller.uiTraits.manage_binaries_nav_item_enabled">
        Manage Binaries
      </li>
      <li grr-nav-link state="config"
          disabled="!controller.uiTraits.settings_nav_item_enabled">
        Settings
      </li>
      <li grr-nav-link state="artifacts"
          disabled="!controller.uiTraits.artifact_manager_nav_item_enabled">
        Artifact Manager
      </li>
    </ul>
  </section>
</div>
